package com.go.where.manager.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.go.where.manager.dao.TeacherRelationDao;
import com.go.where.manager.pojo.TeacherRelationInfo;

@Repository("teacherRelationDao")
public class TeacherRelationDaoImpl extends BaseDaoImpl<TeacherRelationInfo>
		implements TeacherRelationDao {

	@Override
	protected String getNameSpace() {
		return "mybatis.xml.TeacherRelationMapper";
	}

	@Override
	public TeacherRelationInfo queryByTidAndCid(TeacherRelationInfo relationInfo) {
		return getSqlSession().selectOne(getNameSpace() + ".queryByTidAndCid",
				relationInfo);
	}

	@Override
	public List<TeacherRelationInfo> queryByCourseId(String courseId) {
		return getSqlSession().selectList(getNameSpace() + ".queryByCourseId", courseId);
	}

	@Override
	public int updateByCourseId(TeacherRelationInfo relationInfo) {
		return getSqlSession().update(getNameSpace() + ".updateByCourseId", relationInfo);
	}

}
